@if (count($topics))

    <ul class="list-group mt-4 border-0">
        @foreach ($topics as $topic)
            <li class="list-group-item pl-2 pr-2 border-right-0 border-left-0 @if($loop->first) border-top-0 @endif">
                <a href="{{ $topic->publish? route('topics.show', $topic->id):route('topics.edit', $topic->id) }}">
                    <span class="{{ $topic->publish?'':'text-success' }}  ">
                        【{{ $topic->publish?'已发布':'草稿' }}】
                    </span>
                    {{ $topic->title }}
                </a>
                <span class="meta float-right text-secondary">

                    {{ $topic->reply_count }} 回复 ⋅
                    <span>{{ $topic->created_at->diffForHumans() }}</span>
                </span>
            </li>
        @endforeach
    </ul>

    {{-- 分页 --}}
    <div class="mt-4 pt-1">
        {!! $topics->render() !!}
    </div>
@else
    <div class="empty-block d-flex justify-content-center mt-4">暂无数据 ~_~</div>
@endif

